function deserialize_contest(data) {
  var b64 = new Base64();
  c = b64.decode(data).split(";");
  console.log("=============================");
  console.log("Contest Deserialization");
  console.log("name: " + c[0]);
  var tracks_len = parseInt(c[1]);
  console.log("tracks: " + tracks_len);

  var ret = {};
  ret.name = c[0];
  ret.tracks = [];

  for(var i = 0; i < tracks_len; i++) {
    console.log("-----------------------");
    var decoded = b64.decode(c[2+i]).split(";");
    var track = {};
    track.name = decoded[0];
    track.participant = decoded[1];
    track.confirmed = decoded[2] == "confirmed";
    track.confirmed_time_spent = parseInt(decoded[3]);
    track.confirmed_time_order = parseInt(decoded[4]);
    ret.tracks.push(track);
    console.log("track #" + i + ": " + decoded);
  }
  console.log("-----------------------");

  ret.state = c[2+tracks_len];
  console.log("state: " + ret.state);

  console.log("=============================");

  return ret;
}
